package org.aepscolombia.platform.models.entity;
// Generated Apr 8, 2014 9:37:27 AM by Hibernate Tools 3.2.1.GA


import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Districts generated by hbm2java
 */
@Entity
@Table(name="districts"
    , uniqueConstraints = @UniqueConstraint(columnNames="code_dis") 
)
public class Districts  implements java.io.Serializable {


     private Integer idDis;
     private Municipalities municipalities;
     private int codeDis;
     private String nameDis;
     private Integer createdBy;

    public Districts() {
    }

	
    public Districts(Municipalities municipalities, int codeDis, String nameDis) {
        this.municipalities = municipalities;
        this.codeDis = codeDis;
        this.nameDis = nameDis;
    }
    public Districts(Municipalities municipalities, int codeDis, String nameDis, Integer createdBy) {
       this.municipalities = municipalities;
       this.codeDis = codeDis;
       this.nameDis = nameDis;
       this.createdBy = createdBy;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_dis", unique=true, nullable=false)
    public Integer getIdDis() {
        return this.idDis;
    }
    
    public void setIdDis(Integer idDis) {
        this.idDis = idDis;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_municipality_dis", nullable=false)
    public Municipalities getMunicipalities() {
        return this.municipalities;
    }
    
    public void setMunicipalities(Municipalities municipalities) {
        this.municipalities = municipalities;
    }
    
    @Column(name="code_dis", unique=true, nullable=false)
    public int getCodeDis() {
        return this.codeDis;
    }
    
    public void setCodeDis(int codeDis) {
        this.codeDis = codeDis;
    }
    
    @Column(name="name_dis", nullable=false, length=10)
    public String getNameDis() {
        return this.nameDis;
    }
    
    public void setNameDis(String nameDis) {
        this.nameDis = nameDis;
    }
    
    @Column(name="created_by")
    public Integer getCreatedBy() {
        return this.createdBy;
    }
    
    public void setCreatedBy(Integer createdBy) {
        this.createdBy = createdBy;
    }

}


